package com.prs.crm.domain.sys;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.prs.crm.domain.BaseEntity;
import com.prs.crm.domain.store.StoreIn;
import com.prs.crm.domain.store.StoreOut;

/**
 * 編碼庫
 * 
 * @author 兰小刚
 * 
 */
@Entity
@Table(name = "cd_codeAll")
public class Code extends BaseEntity {

	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;
	/**
	 * 编码方案
	 */
	private String codeType;
	/**
	 * 编码类型
	 */
	private String codeMolde;
	/**
	 * 编码数值
	 */
	private String codeValue;
	/**
	 * 实体的名称
	 */
	@Column(length=100)
	private String entityName;


	
	
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getCodeType() {
		return codeType;
	}

	public void setCodeType(String codeType) {
		this.codeType = codeType;
	}

	public String getCodeValue() {
		return codeValue;
	}

	public void setCodeValue(String codeValue) {
		this.codeValue = codeValue;
	}


	public void setEntityName(String entityName) {
		this.entityName = entityName;
	}

	public String getEntityName() {
		return entityName;
	}
	
	public String getCodeMolde() {
		return codeMolde;
	}

	public void setCodeMolde(String codeMolde) {
		this.codeMolde = codeMolde;
	}

	public String getDomainName()
	{
		if (entityName.equals(StoreIn.class.getName()))
			return "入库单";
		else if (entityName.equals(StoreOut.class.getName()))
			return "出库单";
		else
			return "";
	}
}